package com.atguigu.realtime.util;

import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @Author lizhenchao@atguigu.cn
 * @Date 2021/11/27 14:10
 */
public class ThreadPoolUtil {
    public static ThreadPoolExecutor getThreadPool() {
        return new ThreadPoolExecutor(
            300,  // 线程池核心的线程的数量
            500,
            30,
            TimeUnit.SECONDS,
            new LinkedBlockingDeque<>(100)
        );
    }
}
